home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / Main.dxr / 00004_PRINT Scripts.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  3.1 KB  |  79 lines

  1. global gMasterData, gMachineData, gNoteArchive
  2.  
  3. on gatherAllParts
  4.   if activationOn(gMasterData, #menu1, #menu1) then
  5.     set vText_1 to the text of member "menu1 field" of castLib "Shared"
  6.   else
  7.     set vText_1 to "Part 1: Taking a Look, not completed by user." & RETURN & "--------------------------------------------------------------"
  8.   end if
  9.   if activationOn(gMasterData, #menu2, #menu2) then
  10.     set vText_2 to the text of member "menu2 field" of castLib "Shared"
  11.   else
  12.     set vText_2 to "Part 2: Thinking Big, not completed by user." & RETURN & "--------------------------------------------------------------"
  13.   end if
  14.   if activationOn(gMasterData, #menu3, #menu3) then
  15.     set vText_3 to the text of member "menu3 field" of castLib "Shared"
  16.   else
  17.     set vText_3 to "Part 3: Getting Together, not completed by user." & RETURN & "--------------------------------------------------------------"
  18.   end if
  19.   if activationOn(gMasterData, #menu4, #menu4) then
  20.     set vText_4 to the text of member "menu4 field" of castLib "Shared"
  21.   else
  22.     set vText_4 to "Part 4: Using Decision-Making Strategies, not completed by user." & RETURN & "--------------------------------------------------------------"
  23.   end if
  24.   set vAllText to "Workplace Effectiveness, Decision-Making Strategies" & RETURN & "Exploration begun at " & getTimeDate(gMachineData) & RETURN & RETURN
  25.   put vText_1 & RETURN & RETURN & vText_2 & RETURN & RETURN & vText_3 & RETURN & RETURN & vText_4 & RETURN & RETURN after vAllText
  26.   if voidp(gNoteArchive) then
  27.     put "No notes were entered during this session." & RETURN after vAllText
  28.   else
  29.     put "The following are the notes you entered during this session:" & RETURN & gNoteArchive & RETURN after vAllText
  30.   end if
  31.   set the text of member "PrintAllAnswers" to vAllText
  32.   return vAllText
  33. end
  34.  
  35. on addLineFeed vTextChunk
  36.   set vLines to the number of lines in vTextChunk
  37.   set vLF to numToChar(10)
  38.   repeat with X = 2 to vLines
  39.     put vLF before line X of vTextChunk
  40.   end repeat
  41.   return vTextChunk
  42. end
  43.  
  44. on saveTextToFile vTextChunk
  45.   if the platform starts "Win" then
  46.     set vTextChunk to addLineFeed(vTextChunk)
  47.   end if
  48.   set fileObject to new(xtra("fileio"))
  49.   if the platform starts "Mac" then
  50.     set vFileName to "Decision-Making data"
  51.   else
  52.     set vFileName to "Decision.txt"
  53.   end if
  54.   set vFilePath to displaySave(fileObject, "Save your data as:", vFileName)
  55.   if not voidp(vFilePath) and (vFilePath <> EMPTY) then
  56.     createFile(fileObject, vFilePath)
  57.     openFile(fileObject, vFilePath, 0)
  58.     setFinderInfo(fileObject, "TEXT ttxt")
  59.     writeString(fileObject, vTextChunk)
  60.     set vStatus to error(fileObject, status(fileObject))
  61.     if vStatus <> "OK" then
  62.       alert("Error writing file:" && vStatus)
  63.     end if
  64.     closeFile(fileObject)
  65.   end if
  66.   set fileObject to 0
  67. end
  68.  
  69. on FindfieldNames thisCast
  70.   set fieldNameList to []
  71.   set vCastNameOrNum to thisCast
  72.   repeat with X = 1 to 600
  73.     if the type of member X of castLib vCastNameOrNum = #field then
  74.       add(fieldNameList, the name of member X of castLib vCastNameOrNum)
  75.     end if
  76.   end repeat
  77.   put fieldNameList
  78. end
  79.